﻿using AgileShare.Framework.CamlQueries;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using Microsoft.SharePoint;

namespace AgileShare.Framework.Test
{
    
    
    /// <summary>
    ///这是 CamlQueryHelperTest 的测试类，旨在
    ///包含所有 CamlQueryHelperTest 单元测试
    ///</summary>
    [TestClass()]
    public class CamlQueryHelperTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///获取或设置测试上下文，上下文提供
        ///有关当前测试运行及其功能的信息。
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region 附加测试特性
        // 
        //编写测试时，还可使用以下特性:
        //
        //使用 ClassInitialize 在运行类中的第一个测试前先运行代码
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //使用 ClassCleanup 在运行完类中的所有测试后再运行代码
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //使用 TestInitialize 在运行每个测试前先运行代码
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //使用 TestCleanup 在运行完每个测试后运行代码
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///GetItems 的测试
        ///</summary>
        [TestMethod()]
        public void GetItemsTest()
        {
            CamlQueryBuilder camlQueryBuilder = null; // TODO: 初始化为适当的值
            SPList list = null; // TODO: 初始化为适当的值
            Nullable<uint> rowLimit = new Nullable<uint>(); // TODO: 初始化为适当的值
            SPListItemCollection expected = null; // TODO: 初始化为适当的值
            SPListItemCollection actual;
            actual = CamlQueryHelper.GetItems(camlQueryBuilder, list, rowLimit);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///GetItems 的测试
        ///</summary>
        [TestMethod()]
        public void GetItemsTest1()
        {
            Guid fieldId = new Guid(); // TODO: 初始化为适当的值
            ComparisonOperator comparisonOperator = new ComparisonOperator(); // TODO: 初始化为适当的值
            object value = null; // TODO: 初始化为适当的值
            CamlValueType valueType = new CamlValueType(); // TODO: 初始化为适当的值
            SPList list = null; // TODO: 初始化为适当的值
            Nullable<uint> rowLimit = new Nullable<uint>(); // TODO: 初始化为适当的值
            Guid[] viewFieldIds = null; // TODO: 初始化为适当的值
            SPListItemCollection expected = null; // TODO: 初始化为适当的值
            SPListItemCollection actual;
            actual = CamlQueryHelper.GetItems(fieldId, comparisonOperator, value, valueType, list, rowLimit, viewFieldIds);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///GetItems 的测试
        ///</summary>
        [TestMethod()]
        public void GetItemsTest2()
        {
            string fieldName = string.Empty; // TODO: 初始化为适当的值
            ComparisonOperator comparisonOperator = new ComparisonOperator(); // TODO: 初始化为适当的值
            object value = null; // TODO: 初始化为适当的值
            CamlValueType valueType = new CamlValueType(); // TODO: 初始化为适当的值
            SPList list = null; // TODO: 初始化为适当的值
            Nullable<uint> rowLimit = new Nullable<uint>(); // TODO: 初始化为适当的值
            string[] viewFieldNames = null; // TODO: 初始化为适当的值
            SPListItemCollection expected = null; // TODO: 初始化为适当的值
            SPListItemCollection actual;
            actual = CamlQueryHelper.GetItems(fieldName, comparisonOperator, value, valueType, list, rowLimit, viewFieldNames);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///GetItems 的测试
        ///</summary>
        [TestMethod()]
        public void GetItemsTest3()
        {
            Guid fieldId = new Guid(); // TODO: 初始化为适当的值
            ComparisonOperator comparisonOperator = new ComparisonOperator(); // TODO: 初始化为适当的值
            object value = null; // TODO: 初始化为适当的值
            CamlValueType valueType = new CamlValueType(); // TODO: 初始化为适当的值
            Guid orderByFieldId = new Guid(); // TODO: 初始化为适当的值
            OrderByDirection orderByDirection = new OrderByDirection(); // TODO: 初始化为适当的值
            SPList list = null; // TODO: 初始化为适当的值
            Nullable<uint> rowLimit = new Nullable<uint>(); // TODO: 初始化为适当的值
            Guid[] viewFieldIds = null; // TODO: 初始化为适当的值
            SPListItemCollection expected = null; // TODO: 初始化为适当的值
            SPListItemCollection actual;
            actual = CamlQueryHelper.GetItems(fieldId, comparisonOperator, value, valueType, orderByFieldId, orderByDirection, list, rowLimit, viewFieldIds);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///GetItems 的测试
        ///</summary>
        [TestMethod()]
        public void GetItemsTest4()
        {
            string fieldName = string.Empty; // TODO: 初始化为适当的值
            ComparisonOperator comparisonOperator = new ComparisonOperator(); // TODO: 初始化为适当的值
            object value = null; // TODO: 初始化为适当的值
            CamlValueType valueType = new CamlValueType(); // TODO: 初始化为适当的值
            string orderByFieldName = string.Empty; // TODO: 初始化为适当的值
            OrderByDirection orderByDirection = new OrderByDirection(); // TODO: 初始化为适当的值
            SPList list = null; // TODO: 初始化为适当的值
            Nullable<uint> rowLimit = new Nullable<uint>(); // TODO: 初始化为适当的值
            string[] viewFieldNames = null; // TODO: 初始化为适当的值
            SPListItemCollection expected = null; // TODO: 初始化为适当的值
            SPListItemCollection actual;
            actual = CamlQueryHelper.GetItems(fieldName, comparisonOperator, value, valueType, orderByFieldName, orderByDirection, list, rowLimit, viewFieldNames);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///GetItems 的测试
        ///</summary>
        [TestMethod()]
        public void GetItemsTest5()
        {
            CamlQueryBuilder camlQueryBuilder = null; // TODO: 初始化为适当的值
            string listUrl = string.Empty; // TODO: 初始化为适当的值
            SPWeb web = null; // TODO: 初始化为适当的值
            Nullable<uint> rowLimit = new Nullable<uint>(); // TODO: 初始化为适当的值
            SPListItemCollection expected = null; // TODO: 初始化为适当的值
            SPListItemCollection actual;
            actual = CamlQueryHelper.GetItems(camlQueryBuilder, listUrl, web, rowLimit);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///GetItems 的测试
        ///</summary>
        [TestMethod()]
        public void GetItemsTest6()
        {
            Guid fieldId = new Guid(); // TODO: 初始化为适当的值
            ComparisonOperator comparisonOperator = new ComparisonOperator(); // TODO: 初始化为适当的值
            object value = null; // TODO: 初始化为适当的值
            CamlValueType valueType = new CamlValueType(); // TODO: 初始化为适当的值
            string listUrl = string.Empty; // TODO: 初始化为适当的值
            SPWeb web = null; // TODO: 初始化为适当的值
            Nullable<uint> rowLimit = new Nullable<uint>(); // TODO: 初始化为适当的值
            Guid[] viewFieldIds = null; // TODO: 初始化为适当的值
            SPListItemCollection expected = null; // TODO: 初始化为适当的值
            SPListItemCollection actual;
            actual = CamlQueryHelper.GetItems(fieldId, comparisonOperator, value, valueType, listUrl, web, rowLimit, viewFieldIds);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///GetItems 的测试
        ///</summary>
        [TestMethod()]
        public void GetItemsTest7()
        {
            string fieldName = string.Empty; // TODO: 初始化为适当的值
            ComparisonOperator comparisonOperator = new ComparisonOperator(); // TODO: 初始化为适当的值
            object value = null; // TODO: 初始化为适当的值
            CamlValueType valueType = new CamlValueType(); // TODO: 初始化为适当的值
            string listUrl = string.Empty; // TODO: 初始化为适当的值
            SPWeb web = null; // TODO: 初始化为适当的值
            Nullable<uint> rowLimit = new Nullable<uint>(); // TODO: 初始化为适当的值
            string[] viewFieldNames = null; // TODO: 初始化为适当的值
            SPListItemCollection expected = null; // TODO: 初始化为适当的值
            SPListItemCollection actual;
            actual = CamlQueryHelper.GetItems(fieldName, comparisonOperator, value, valueType, listUrl, web, rowLimit, viewFieldNames);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///GetItems 的测试
        ///</summary>
        [TestMethod()]
        public void GetItemsTest8()
        {
            Guid fieldId = new Guid(); // TODO: 初始化为适当的值
            ComparisonOperator comparisonOperator = new ComparisonOperator(); // TODO: 初始化为适当的值
            object value = null; // TODO: 初始化为适当的值
            CamlValueType valueType = new CamlValueType(); // TODO: 初始化为适当的值
            Guid orderByFieldId = new Guid(); // TODO: 初始化为适当的值
            OrderByDirection orderByDirection = new OrderByDirection(); // TODO: 初始化为适当的值
            string listUrl = string.Empty; // TODO: 初始化为适当的值
            SPWeb web = null; // TODO: 初始化为适当的值
            Nullable<uint> rowLimit = new Nullable<uint>(); // TODO: 初始化为适当的值
            Guid[] viewFieldIds = null; // TODO: 初始化为适当的值
            SPListItemCollection expected = null; // TODO: 初始化为适当的值
            SPListItemCollection actual;
            actual = CamlQueryHelper.GetItems(fieldId, comparisonOperator, value, valueType, orderByFieldId, orderByDirection, listUrl, web, rowLimit, viewFieldIds);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///GetItems 的测试
        ///</summary>
        [TestMethod()]
        public void GetItemsTest9()
        {
            string fieldName = string.Empty; // TODO: 初始化为适当的值
            ComparisonOperator comparisonOperator = new ComparisonOperator(); // TODO: 初始化为适当的值
            object value = null; // TODO: 初始化为适当的值
            CamlValueType valueType = new CamlValueType(); // TODO: 初始化为适当的值
            string orderByFieldName = string.Empty; // TODO: 初始化为适当的值
            OrderByDirection orderByDirection = new OrderByDirection(); // TODO: 初始化为适当的值
            string listUrl = string.Empty; // TODO: 初始化为适当的值
            SPWeb web = null; // TODO: 初始化为适当的值
            Nullable<uint> rowLimit = new Nullable<uint>(); // TODO: 初始化为适当的值
            string[] viewFieldNames = null; // TODO: 初始化为适当的值
            SPListItemCollection expected = null; // TODO: 初始化为适当的值
            SPListItemCollection actual;
            actual = CamlQueryHelper.GetItems(fieldName, comparisonOperator, value, valueType, orderByFieldName, orderByDirection, listUrl, web, rowLimit, viewFieldNames);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///TryGetListByRelativeUrl 的测试
        ///</summary>
        [TestMethod()]
        [DeploymentItem("AgileShare.Framework.dll")]
        public void TryGetListByRelativeUrlTest()
        {
            string relativeUrl = string.Empty; // TODO: 初始化为适当的值
            SPWeb web = null; // TODO: 初始化为适当的值
            SPList expected = null; // TODO: 初始化为适当的值
            SPList actual;
            actual = CamlQueryHelper_Accessor.TryGetListByRelativeUrl(relativeUrl, web);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
    }
}
